﻿using Shake.Business.Infrastructures;
using Shake.Domain.Models;
using Shake.Framework.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Shake.Framework.Mvc;
using Shake.Framework.View;
using Shake.Domain.Models;
using Shake.Framework.Attributes;

namespace Shake.Web.Controllers
{
    [Theme]
    public class QualificationController : Controller
    {
        public IQualificationService _qualService { get; set; }
        public ActionResult Index()
        {
            //var data = _postInfoService.GetAll();
            return this.Shake();
        }
        public ActionResult GetByUserId(string userId)
        {
            var results = _qualService.GetByUserId(userId);
            return Json(results);
        }
        public ActionResult Get()
        {
            var results = _qualService.GetAll();
            return Json(results);
        }
        public ActionResult Save(List<Qualification> entitys)
        {
            foreach (var item in entitys)
            {
                _qualService.Save(item);
            }
            return Json(entitys);
        }

        public ActionResult Remove(List<Qualification> entitys)
        {
            _qualService.Remove(entitys);
            return Json(entitys);
        }
    }
}